home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
Other Langs
/
Parallaxis_20
/
matrix.z
< prev
next >
Wrap
Text File
|
1991-05-02
|
5KB
|
166 lines
START
100 PE
4 PORTS
SCALAR I2 3( 10( R10 ) ) I4
VECTOR I2
1 : GOTO 73;
2 : PROC 1 VECTOR I1;
POPV VI1:1;
VI[VI1:1] := 0;
PUSHV VI1:1;
RETURN;
3 : PROC 1;
ERROR "value out of range";
RETURN;
4 : PROC 1
SCALAR
VECTOR I3 I1; group number 1
PUSHV ADDR VI1:3;
5 : VI1:1 := ID - 1; for GRID calculating DIMi
VI1:2 := VI1:1 MOD 10; DIM2
VI1:1 := VI1:1 / 10; DIM1
6 : VI1:3 := VI1:1 * 10;
7 : VI1:4 := VI1:2 - 1;
8 : VI1:4 := VI1:4 MOD 10;
9 : VI1:3 := VI1:3 + VI1:4;
VI1:3 := VI1:3 + 1;
IF VI1:1 < 0 CALL 2;
IF VI1:1 > 9 CALL 2;
IF VI1:4 < 0 CALL 2;
IF VI1:4 > 9 CALL 2;
CONNECT 1 TO 1 AT VI1:3;
10 : VI1:4 := VI1:1 - 1;
11 : VI1:4 := VI1:4 MOD 10;
12 : VI1:3 := VI1:4 * 10;
13 : VI1:3 := VI1:3 + VI1:2;
VI1:3 := VI1:3 + 1;
IF VI1:4 < 0 CALL 2;
IF VI1:4 > 9 CALL 2;
IF VI1:2 < 0 CALL 2;
IF VI1:2 > 9 CALL 2;
CONNECT 2 TO 2 AT VI1:3;
14 : VI1:3 := VI1:1 * 10;
15 : VI1:4 := VI1:2 - VI1:1;
16 : VI1:4 := VI1:4 MOD 10;
17 : VI1:3 := VI1:3 + VI1:4;
VI1:3 := VI1:3 + 1;
IF VI1:1 < 0 CALL 2;
IF VI1:1 > 9 CALL 2;
IF VI1:4 < 0 CALL 2;
IF VI1:4 > 9 CALL 2;
CONNECT 3 TO 3 AT VI1:3;
18 : VI1:4 := VI1:1 - VI1:2;
19 : VI1:4 := VI1:4 MOD 10;
20 : VI1:3 := VI1:4 * 10;
21 : VI1:3 := VI1:3 + VI1:2;
VI1:3 := VI1:3 + 1;
IF VI1:4 < 0 CALL 2;
IF VI1:4 > 9 CALL 2;
IF VI1:2 < 0 CALL 2;
IF VI1:2 > 9 CALL 2;
CONNECT 4 TO 4 AT VI1:3;
22 : POPV VI1:3;
23 : RETURN; group number : 1
24 : PROC 1; configuration : GRID
VI0:1 := ID - 1; for GRID calculating DIMi
VI0:2 := VI0:1 MOD 10; DIM2
VI0:1 := VI0:1 / 10; DIM1
RETURN; configuration : GRID
25 : PROC 1
SCALAR I3 I1 I1
VECTOR R3 R1 ; MATRIX_MULT
26!16 : POPS SI1:3;
27 : POPS SI1:2;
28 : POPS SI1:1;
29!21 : CALL 24; line 21 column 2
30 : LOAD VR1:1 WITH SR[SI1:1];
31!22 : LOAD VR1:2 WITH SR[SI1:2]; line 22 column 2
32!23 : CALL 24; line 23 column 2
33!24 : PROPAGATE VR1:1 OUT 3 IN 3; line 24 column 4
34!25 : PROPAGATE VR1:2 OUT 4 IN 4; line 25 column 4
35!26 : VR1:3 := VR1:1 * VR1:2; line 26 column 4
36!27 : SI1:4 := 2; line 27 column 4
37 : SI1:5 := 10;
38!27 : IF SI1:4 > SI1:5 GOTO 45; line 27 column 4
39!28 : PROPAGATE VR1:1 OUT 1 IN 1; line 28 column 6
40!29 : PROPAGATE VR1:2 OUT 2 IN 2; line 29 column 6
41!30 : VR1:4 := VR1:1 * VR1:2; line 30 column 6
42 : VR1:3 := VR1:3 + VR1:4;
43 : SI1:4 := SI1:4 + 1;
44 : GOTO 38;
45!33 : CALL 24; line 33 column 2
46 : STORE VR1:3 TO SR[SI1:3];
47!34 : RETURN; MATRIX_MULT
48 : PROC 1
SCALAR I1 I2 I4 ; OUT
49!37 : POPS SI1:1;
50!40 : SI1:2 := 1; line 40 column 2
51 : SI1:4 := 10;
52!40 : IF SI1:2 > SI1:4 GOTO 71; line 40 column 2
53!41 : SI1:3 := 1; line 41 column 4
54 : SI1:5 := 10;
55!41 : IF SI1:3 > SI1:5 GOTO 68; line 41 column 4
56!41 : IF SI1:2 < 1 CALL 3; line 41 column 23
57 : IF 10 < SI1:2 CALL 3;
58 : IF SI1:3 < 1 CALL 3;
59 : IF 10 < SI1:3 CALL 3;
60 : SI1:6 := SI1:1 - SIZE( R10 R1 );
61 : SI1:7 := SI1:3 * SIZE( R1 );
62 : SI1:6 := SI1:6 + SI1:7;
63 : SI1:7 := SI1:2 * SIZE( R10 );
64 : SI1:6 := SI1:6 + SI1:7;
65 : WRITE SR[SI1:6] 10 2;
66 : SI1:3 := SI1:3 + 1;
67 : GOTO 55;
68!42 : WRITE EOL; line 42 column 4
69 : SI1:2 := SI1:2 + 1;
70 : GOTO 52;
71!44 : WRITE EOL; line 44 column 2
72!45 : RETURN; OUT
73 : CALL 4; connections
74!49 : SI0:1 := 1; line 49 column 2
75 : SI0:3 := 10;
76!49 : IF SI0:1 > SI0:3 GOTO 107; line 49 column 2
77!50 : SI0:2 := 1; line 50 column 4
78 : SI0:4 := 10;
79!50 : IF SI0:2 > SI0:4 GOTO 105; line 50 column 4
80!51 : IF SI0:1 < 1 CALL 3; line 51 column 6
81 : IF 10 < SI0:1 CALL 3;
82 : IF SI0:2 < 1 CALL 3;
83 : IF 10 < SI0:2 CALL 3;
84 : SI0:5 := ADDR SR0:1 - SIZE( R10 R1 );
85 : SI0:6 := SI0:2 * SIZE( R1 );
86 : SI0:5 := SI0:5 + SI0:6;
87 : SI0:6 := SI0:1 * SIZE( R10 );
88 : SI0:5 := SI0:5 + SI0:6;
89 : SI0:6 := 10 * SI0:1;
90 : SI0:6 := SI0:6 + SI0:2;
91 : SR[SI0:5] := SI0:6;
92!52 : IF SI0:1 < 1 CALL 3; line 52 column 6
93 : IF 10 < SI0:1 CALL 3;
94 : IF SI0:2 < 1 CALL 3;
95 : IF 10 < SI0:2 CALL 3;
96 : SI0:5 := ADDR SR0:101 - SIZE( R10 R1 );
97 : SI0:6 := SI0:2 * SIZE( R1 );
98 : SI0:5 := SI0:5 + SI0:6;
99 : SI0:6 := SI0:1 * SIZE( R10 );
100 : SI0:5 := SI0:5 + SI0:6;
101 : SI0:6 := SI0:1 + SI0:2;
102 : SR[SI0:5] := SI0:6;
103 : SI0:2 := SI0:2 + 1;
104 : GOTO 79;
105 : SI0:1 := SI0:1 + 1;
106 : GOTO 76;
107!55 : PUSHS ADDR SR0:1; line 55 column 2
108 : CALL 48; OUT
109!55 : PUSHS ADDR SR0:101; line 55 column 10
110 : CALL 48; OUT
111!56 : PUSHS ADDR SR0:1; line 56 column 2
112 : PUSHS ADDR SR0:101;
113 : PUSHS ADDR SR0:201;
114 : CALL 25; MATRIX_MULT
115!57 : PUSHS ADDR SR0:201; line 57 column 2
116 : CALL 48; OUT
117 : END; SYSTOLIC_ARRAY
STOP